package com.cxx.service.impl;

import com.cxx.dao.DepartmentDao;
import com.cxx.dao.impl.DepartmentDaoImpl;
import com.cxx.entity.Department;
import com.cxx.service.DepartmentService;

import java.util.List;

public class DepartmentServiceImpl implements DepartmentService {
    private DepartmentDao deptDao = (DepartmentDao) new DepartmentDaoImpl();

    @Override
    public int add(Department dept) {
        return this.deptDao.sava(dept);
    }

    @Override
    public List<Department> findAll() {
        return this.deptDao.findAll();
    }

    @Override
    public int delete(int deptno) {

        return this.deptDao.delete(deptno);
    }

    @Override
    public Department findById(int deptno) {
        return this.deptDao.findById(deptno);
    }

    @Override
    public int update(Department dept) {
        return this.deptDao.update(dept);
    }
}
